package top.z.orm.handle.distribution;

import top.z.orm.core.distribution.Worker;
import top.z.orm.core.osql.exception.ConfigWrongException;
import top.z.orm.handle.osql.core.HoneyConfig;

public class DefaultWorker implements Worker {

    @Override
    public long getWorkerId() {
        int workerId = HoneyConfig.getHoneyConfig().workerid;
        if (workerId < 0 || workerId > 1023) throw new ConfigWrongException(" workerId is wrong. need in [0,1023]");
        return workerId;
    }
}